Repository navigation
Run Map: renew the Battle.net sign-in and start the game in the user's own registry view - #1629
Merged
Merged
Conversation
…s own registry view A process started from a packaged (MSIX) app, such as the Claude desktop app or a VS Code started from a terminal inside it, reads and writes HKCU through the package's private copy, and so does everything it starts, reg.exe included. Battle.net, the renewal and the client hand the sign-in to each other through HKCU, so a Wurst running in such a context read WEB_TOKEN, wrote EDITOR_TOKEN and started the game where the rest of the machine never saw them: tokens got lost and clients stopped at the login panel. OutsideStart starts a process through WMI (Win32_Process.Create), which runs it in the user's own context, in the same session and on the same desktop, and returns its pid; startOrHere falls back to ProcessBuilder when WMI cannot. The renewal now runs battlenet-token.ps1, a byte-identical copy of the wc3-e2e-harness script, from a content-named temp copy, started outside and hidden. Its output goes to a file (UTF-16 with BOM) that Wurst polls, counting complete lines only. Outcomes map to messages: refreshed, no-token, app-game-running, and the new token-not-visible, which tells the user that Battle.net itself runs in a packaged app's private registry and must be started from the Start menu. The Java polling loop and its reg.exe writes are gone. The lock, the window watcher, cancellation (which ends the script, then closes a late client) and releaseWhenSignedIn stay; the latter reads EDITOR_TOKEN once after the renewal and falls back to its 120 s timeout. Run Map starts the client outside too (normal window, Wurst's working directory) and hands its pid to BattleNetLaunchWindows, falling back to the direct start with a log line. Mirrors Frotty/wc3-e2e-harness#62.
The script ends right after its result line, but could still hold the file open when Run Map deleted it, leaving it to deleteOnExit in a language server that runs for days. Wait up to 5 s for the script to exit first, as the harness does (Frotty/wc3-e2e-harness#62).
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Run Map renews the
-editorsign-in from the Battle.net app by copying the one-timeWEB_TOKENtoEDITOR_TOKEN, then starts the game. Battle.net, the renewal and the game hand the sign-in to each other throughHKCU.A process started from a packaged (MSIX) app, such as the Claude desktop app or a VS Code started from a terminal inside it, reads and writes
HKCUthrough the package's private copy, and so does everything it starts. Wurst'sreg.execalls, the Battle.net it asked to launch and the game it started could each see a different registry from the rest of the machine. Tokens got lost, and clients stopped at the login panel.When Battle.net itself had been started from inside such an app, the renewal reported "Battle.net did not start Warcraft III. Check that it is signed in…". That message does not describe the cause.
Change
OutsideStart(new) starts a process through WMI (Win32_Process.Create), in the user's own context, on the same desktop. If WMI cannot start it, it falls back toProcessBuilder.The renewal now runs an embedded
battlenet-token.ps1outside Wurst's registry view, hidden. Wurst reads its outcome from a redirected output file:On cancellation it ends the script and closes any late client, as before.
This replaces the Java polling loop. The lock, the window watcher and
releaseWhenSignedInare kept.New outcome
token-not-visible: Battle.net started the game but no new token appeared. The user is told to quit Battle.net from its tray icon and start it from the Start menu.Run Map starts the game through
OutsideStarton Windows, with the same working directory as before.BattleNetLaunchWindows.handOffnow takes a pid.Validation
./gradlew compileJava test --tests '*BattleNet*' --tests '*OutsideStart*'passes: BattleNetSignInTest 14, OutsideStartTest 3, BattleNetLaunchWindowsTest 1. The tests cover:java.exefrom a directory with spaces, checking that arguments with spaces, quotes and trailing backslashes, and the working directory, arrive intact;